﻿using Microsoft.Extensions.Configuration;
using MiniFox.Configurations;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Tasks.Configurations
{
    /// <summary>
    /// 
    /// </summary>
    public class TaskItemConfig
    {
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("name")]
        public string Name
        {
            get; set;
        }
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("scheduleType")]
        public ScheduleType ScheduleType
        {
            get;
            set;
        } = ScheduleType.Iteration;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("duration")]
        public int Duration
        {
            get;
            set;
        } = 60;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("durationUnit")]
        public DurationUnit DurationUnit
        {
            get;
            set;
        } = DurationUnit.Second;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("startTime")]
        public DateTime? StartTime
        {
            get; set;
        } = DateTime.Now;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("endTime")]
        public DateTime? EndTime
        {
            get; set;
        }
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("taskItemType")]
        public Type TaskItemType
        {
            get; set;
        }
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("stopOnError")]
        public bool StopOnError
        {
            get; set;
        }
        /// <summary>
        /// 
        /// </summary>    
        [ConfigurationKeyName("actions")]
        public ProviderSettingsCollection TaskActions
        {
            get; set;
        }

    }
}
